Optimal. Leaf size=65 \[ -\frac {\log (x) (2 A b-a B)}{a^3}+\frac {(2 A b-a B) \log (a+b x)}{a^3}-\frac {A b-a B}{a^2 (a+b x)}-\frac {A}{a^2 x} \]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {27, 77} \begin {gather*} -\frac {A b-a B}{a^2 (a+b x)}-\frac {\log (x) (2 A b-a B)}{a^3}+\frac {(2 A b-a B) \log (a+b x)}{a^3}-\frac {A}{a^2 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 77
Rubi steps
\begin {align*} \int \frac {A+B x}{x^2 \left (a^2+2 a b x+b^2 x^2\right )} \, dx &=\int \frac {A+B x}{x^2 (a+b x)^2} \, dx\\ &=\int \left (\frac {A}{a^2 x^2}+\frac {-2 A b+a B}{a^3 x}-\frac {b (-A b+a B)}{a^2 (a+b x)^2}-\frac {b (-2 A b+a B)}{a^3 (a+b x)}\right ) \, dx\\ &=-\frac {A}{a^2 x}-\frac {A b-a B}{a^2 (a+b x)}-\frac {(2 A b-a B) \log (x)}{a^3}+\frac {(2 A b-a B) \log (a+b x)}{a^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 56, normalized size = 0.86 \begin {gather*} \frac {\frac {a (a B-A b)}{a+b x}+\log (x) (a B-2 A b)+(2 A b-a B) \log (a+b x)-\frac {a A}{x}}{a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A+B x}{x^2 \left (a^2+2 a b x+b^2 x^2\right )} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.40, size = 107, normalized size = 1.65 \begin {gather*} -\frac {A a^{2} - {\left (B a^{2} - 2 \, A a b\right )} x + {\left ({\left (B a b - 2 \, A b^{2}\right )} x^{2} + {\left (B a^{2} - 2 \, A a b\right )} x\right )} \log \left (b x + a\right ) - {\left ({\left (B a b - 2 \, A b^{2}\right )} x^{2} + {\left (B a^{2} - 2 \, A a b\right )} x\right )} \log \relax (x)}{a^{3} b x^{2} + a^{4} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 71, normalized size = 1.09 \begin {gather*} \frac {{\left (B a - 2 \, A b\right )} \log \left ({\left | x \right |}\right )}{a^{3}} + \frac {B a x - 2 \, A b x - A a}{{\left (b x^{2} + a x\right )} a^{2}} - \frac {{\left (B a b - 2 \, A b^{2}\right )} \log \left ({\left | b x + a \right |}\right )}{a^{3} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 78, normalized size = 1.20 \begin {gather*} -\frac {A b}{\left (b x +a \right ) a^{2}}-\frac {2 A b \ln \relax (x )}{a^{3}}+\frac {2 A b \ln \left (b x +a \right )}{a^{3}}+\frac {B}{\left (b x +a \right ) a}+\frac {B \ln \relax (x )}{a^{2}}-\frac {B \ln \left (b x +a \right )}{a^{2}}-\frac {A}{a^{2} x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.53, size = 67, normalized size = 1.03 \begin {gather*} -\frac {A a - {\left (B a - 2 \, A b\right )} x}{a^{2} b x^{2} + a^{3} x} - \frac {{\left (B a - 2 \, A b\right )} \log \left (b x + a\right )}{a^{3}} + \frac {{\left (B a - 2 \, A b\right )} \log \relax (x)}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.12, size = 58, normalized size = 0.89 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {2\,b\,x}{a}+1\right )\,\left (2\,A\,b-B\,a\right )}{a^3}-\frac {\frac {A}{a}+\frac {x\,\left (2\,A\,b-B\,a\right )}{a^2}}{b\,x^2+a\,x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.49, size = 128, normalized size = 1.97 \begin {gather*} \frac {- A a + x \left (- 2 A b + B a\right )}{a^{3} x + a^{2} b x^{2}} + \frac {\left (- 2 A b + B a\right ) \log {\left (x + \frac {- 2 A a b + B a^{2} - a \left (- 2 A b + B a\right )}{- 4 A b^{2} + 2 B a b} \right )}}{a^{3}} - \frac {\left (- 2 A b + B a\right ) \log {\left (x + \frac {- 2 A a b + B a^{2} + a \left (- 2 A b + B a\right )}{- 4 A b^{2} + 2 B a b} \right )}}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________